package vo;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import logic.studentQuery_logic.Student;
import po.StuCouScoRecPO;
import datasv.courseQuery_datasv.CourseQueryDatasv;
import datasv.datafactorysv.CourseQueryDatasvFactory;

public class CouStuScoListVO {
	
	private CourseVO courseVO;
	private List<StuCouScoRecPO> stuScoList;
	private Map<Student,Integer> studentScore;
	private CourseQueryDatasv courseQD;
	public CouStuScoListVO(String courseID) {
		courseVO = new CourseVO(courseID);
		courseQD = new CourseQueryDatasvFactory().create();
		stuScoList = courseQD.getAllStuOfCou(courseID);
		getAllStudent();
	}
	private void getAllStudent(){
		studentScore = new HashMap<Student,Integer>();
		for(StuCouScoRecPO rec : stuScoList){
			studentScore.put(new Student(rec.getStudentID()), rec.getScore());
		}
	}
	public CourseVO getCourseVO() {
		return courseVO;
	}
	public Map<Student, Integer> getStudentScore() {
		return studentScore;
	}
	
	
}
